package com.zjj.springmvc.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zjj.springmvc.entity.User;
import com.zjj.springmvc.service.UserService;

@RestController
public class UserController {

	@Autowired
	private UserService userService;

	@RequestMapping("/query")
	public List<User> query() {
		return userService.queryUserList();
	}
	
	@RequestMapping("/query1")
	public List<Map<String, Object>> query1() {
		Map<String, String> paramMap = new HashMap<String, String>();
		return userService.queryUserList(paramMap);
	}
	
	@RequestMapping("/query2")
	public List<Map<String, Object>> query2() {
		Map<String, String> paramMap = new HashMap<String, String>();
		paramMap.put("status", "0");
		paramMap.put("stuId", "216");
		return userService.queryObjectUserList(paramMap);
	}
	
	@RequestMapping("/update")
	public boolean update() {
		return userService.updateUserInfo();
	}
	
	@RequestMapping("/list")
	public void list() {
		userService.queryProduct();
	}
}
